function addShopType(){
    openNewWindow('shopType/view/shopTypeNew',800,600);
}

function lookShopType(id){
    openNewWindow('shopType/findShopType/look/'+id,800,600);
}

function editShopType(id){
    openNewWindow('shopType/findShopType/update/'+id,800,600);
}

function saveShopType() {
    _confirm("系统提示","确认保存分类数据？",{
        buttons:{"确定":true,"取消":false},
        callback:function (v) {
            if(v){
                var data = $("#saveForm").serialize();
                $.post(transferUrl('/shopType/saveShopType'),data,function (result) {
                    _confirm("系统提示",result.message,{callback:function(v){
                        if(result.status=="200"){
                            $("#searchBtn",window.opener.document).click();
                            window.close();
                        }
                        }
                    });
                });
            }
        }
    })
}

function updateShopType() {
    _confirm("系统提示","确认保存分类数据？",{
        buttons:{"确定":true,"取消":false},
        callback:function (v) {
            if(v){
                var data = $("#saveForm").serialize();
                $.post(transferUrl('/shopType/updateShopType'),data,function (result) {
                    _confirm("系统提示",result.message,{callback:function(v){
                            if(result.result=="success"){
                                $("#searchBtn",window.opener.document).click();
                                window.close();
                            }
                        }
                    });
                });
            }
        }
    })
}
/**
 * 刪除分類
 * @param id
 */
function deleteShopType(id) {
    _confirm("操作提示","确认删除该条分类信息？",
    {
        buttons:{"删除":true,"取消":false},
        callback:function (v) {
            if(v)
            {
                $.post(transferUrl("/shopType/deleteShopType"),{"id":id},function (result) {
                    _confirm("操作提示",result.message,{
                        callback:function (v) {
                            if(result.result=="success"){
                                $("#searchBtn").click();
                            }
                        }
                    });
                })
            }
        }
    });
}